<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页</title>
</head>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">
var prevLink = document.referrer;  
if($.trim(prevLink)==''){  
    location.href = 'www.example.com/index.html';  
}else{  
    if(prevLink.indexOf('www.example.com')==-1){    //来自其它站点  
        location.href = 'www.example.com/index.html';  
    }  
    if(prevLink.indexOf('register.html')!=-1){      //来自注册页面  
        location.href = 'www.example.com/index.html';  
    }  
    location.href = prevLink;  
} 
</script>
<body style="text-align: center;">
<h1>欢迎登录!${user.username }</h1>
    <form action="${pageContext.request.contextPath }/loginUser" method="post">
        <input type="text" name="username"><br/> 
        <input type="password" name="password"/><br>
        <input type="submit" value="提交">
    </form>
</body>
</html>